muduo CountDownLatch
class CountDownLatch  noncopyable
{
    public
        explicit CountDownLatch(int count)  count_(count) {}
    void countDown() {
        stdunique_lockstdmutex lock(mutex_);
        if (--count_ == 0) cv_.notify_all();
    }
    void wait() {
        stdunique_lockstdmutex lock(mutex_);
        cv_.wait(lock, [this] { return count_ == 0; });
    }
    private
        mutable stdmutex mutex_;
    stdcondition_variable cv_;
    int count_;
};